class code1 {
    //最长公共前缀
    public String longestCommonPrefix(String[] strs) {
        StringBuffer ret = new StringBuffer("");
        for(int i=0;i<strs[0].length();i++) {
            char s = strs[0].charAt(i);
            for(int j=1;j<strs.length;j++) {
                if(i>strs[j].length()-1||s!=strs[j].charAt(i)) return ret.toString();
            }
            ret.append(s);
        }
        return ret.toString();
    }
}